<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #th,td{
            width: 130px;
            height: 30px;
        }
    </style>
</head>
<body>
    
<div style="width: 100%;">
    <input type="text" value="名">
    <select name="" id="a1">
        <option value="">请选择</option>
        <option selected="true" value="男">男</option>
        <option value="女">女</option>
    </select>
    <input type="text" name="age" value='100'/>
    <input type="button" class="ti" value="提交">
    <p>
    <select name="" id="a2">
        <option value="">选择一个排序字段</option>
        <option value="hao">编号</option>
        <option value="da">大法</option>
    </select>
    <select name="" id="a3">
        <option value="">选择一个方式</option>
        <option value="sheng">升序</option>
        <option value="xu">降序</option>
    </select>
    </p>
    <table border="1">
        <thead>
            <tr>
                <th><input type="checkbox" id="a1">全选</th>
                <th>编号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th><button>操作</button></th>
            </tr>
        </thead>
        <body>
            <tr>
                <td><input type="checkbox" id="box">全选</td>
                <td>1</td>
                <td>小明</td>
                <td>男</td>
                <td>11</td>
                <td><button>上移</button><button>下移</button><button>删除</button></td>
            </tr>
            <tr>
                <td><input type="checkbox" id="box">全选</td>
                <td>2</td>
                <td>小子</td>
                <td>男</td>
                <td>13</td>
                <td><button>上移</button><button>下移</button><button>删除</button></td>
            </tr>
            <tr>
                <td><input type="checkbox" id="box">全选</td>
                <td>1</td>
                <td>小红</td>
                <td>女</td>
                <td>15</td>
                <td><button>上移</button><button>下移</button><button>删除</button></td>
            </tr>
        </body>
    </table>
</div>
</body>
<script>
    window.onload = function () {
        var boxObj = document.getElementsByName('box')
        document.getElementById('a1').addEventListener('change', function (){
            for (let i = 0; i < boxObj.length; i++){
                boxObj[i].checked = this.checked
            }
        })
        for (let i = 0; i < boxObj.length; i++) {
            boxObj[i].addEventListener('chackge', function () {
                var flag = true

                for (let j = 0; j < boxObj.length; j++) {
                    if(!boxObj[j].checked) {
                        flag = false
                    }
                }
                document.getElementById('a1').checked = flag771·
            })
        }
    }


    
</script>
<script>
    var qq = document.getElementsByTagName("tr")
    console.log(qq);
    for (i = 1; i<=qq.length; i++){
        if (i % 2 != 0){
            qq[i].style.background = "coral"
        }
    } 
</script>
</html>